package PTA;

import java.util.Arrays;
import java.util.Scanner;

public class Test {
    public static void main12(String[] args) {
        int x = 1;
        while(true) {
            if(x % 2 == 1 && x % 3 == 2 && x % 4 ==3
                &&x % 5 == 4 && x % 6 ==5 && x% 7 == 0) {
                System.out.println(x);
                break;
            }
            x++;
        }
    }
    public static void main11(String[] args) {
        for (int i = 100; i < 1000; i++) {
            int a = i % 10;
            int b = i / 10 % 10;
            int c = i / 100;
            if(a*a*a + b*b*b + c*c*c == i) {
                System.out.println(i);
            }
        }
    }
    public static void main10(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int key = 0;
        for (int i = 1; i <= n; i++) {
            if(i % 3 == 0 && i % 5 == 0) {
                System.out.print(i+" ");
                key++;
            }
            if(key == 10) {
                System.out.println();
                key -= 10;
            }
        }
    }
    public static void main9(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] A = new int[n];
        for (int i = 0; i < n; i++) {
            A[i] = scan.nextInt();
        }
        int[] B = A.clone();
        Arrays.sort(B);
        int ab = 0;
        int ba = 0;
        int d = 0;
        for (int i = 0; i < n; i++) {
            if(A[i] > B[i]) {
                ab++;
            }
            else if(A[i] < B[i]) {
                ba++;
            }
            else
                d++;

        }
        System.out.println(ab);
        System.out.println(d);
        System.out.println(ba);
    }
    public static void main8(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] R = new int[n];
        for (int i = 0; i < n; i++) {
            R[i] = scan.nextInt();
        }
        //排序
        Arrays.sort(R);
        System.out.println(Arrays.toString(R));
        //逆序
        for (int i = R.length-1; i >= 0 ; i--) {
            System.out.print(R[i]+" ");
        }
        System.out.println();
        //平均半径
        double mid= Arrays.stream(R).sum()/n;
        System.out.println("平均半径="+mid);
        //总面积
        double area = 0;
        for (int x:R) {
            area+=x*x*Math.PI;
        }
        System.out.println("总面积="+String.format("%.6f",area));
    }
    public static void main7(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int s = 0;
        int d = 0;
        for (int i = 1; i <= n; i++) {
            if(i % 3 == 0) {
                if(i % 2 ==0)
                    d++;
                else
                    s++;
            }
        }
        System.out.println(s + "," + d);
    }
    public static void main6(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int[] arr = new int[n];
        int sum1 = 0;
        int sum2 = 0;
        for (int i = 0; i < n; i++) {
            arr[i] = s.nextInt();
            if(arr[i] % 2 == 0) {
                sum2+=arr[i];
            }
            else
                sum1+=arr[i];
        }
        System.out.println("奇数和="+sum1+", 偶数和="+sum2);
    }
    public static void main5(String[] args) {
        Scanner s = new Scanner(System.in);
        int a = s.nextInt();
        double b = s.nextDouble();
        int x1 = s.nextInt();
        int x2 = s.nextInt();
        int x3 = s.nextInt();

        System.out.println(Integer.toBinaryString(a)+" "
                            +Integer.toOctalString(a)+" "
                            +Integer.toHexString(a));
        System.out.println(String.format("%6.2f", b));
        System.out.println(String.format("%5d",x1)+" "+String.format("%5d",x2)+String.format("%5d",x3));
        System.out.println(String.format("%5d",x2)+" "+String.format("%5d",x3)+" "+String.format("%5d",x1));
        System.out.println(String.format("%5d",x3)+" "+String.format("%5d",x1)+" "+String.format("%5d",x2));

    }
    public static void main4(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int c = scan.nextInt();

        System.out.print((a + b + c)+" ");
        System.out.print((a * b * c) + " ");
        System.out.print(String.format("%.2f",((a+b+c)/3.0)));
    }
    public static void main3(String[] args) {
        Scanner scan = new Scanner(System.in);
        int x = scan.nextInt();
        double y = scan.nextDouble();

        System.out.println(x + y);
        System.out.println(Math.sqrt(x + y));
        System.out.print(String.format("%.6f",(x+y)));
    }
    public static void main2(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int[][] arr = new int[N][N];
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                arr[i][j] = scanner.nextInt();
            }
        }
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                System.out.print(arr[j][i]);
                if(j < N -1)
                    System.out.print(" ");
            }
            System.out.println();
        }
    }
    public static void main1(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        //计算能被3整除的奇数和偶数
        int s = 0;
        int d = 0;
        for (int i = 1; i <= n; i++) {
            if(i % 3 == 0) {
                if(i % 2 == 0) {
                    d++;
                }
                else
                    s++;
            }
        }
        System.out.println(s + "," + d);
    }
}
